package com.easybuilder.weixin.service.impl;

import com.easybuilder.weixin.dao.ScoreHistoryDAO;
import com.easybuilder.weixin.entity.ScoreHistory;
import com.easybuilder.weixin.service.ScoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class ScoreServiceImpl implements ScoreService {
    
    @Autowired
    private ScoreHistoryDAO shDao;

    @Override
    public void save(Integer source, String uid, Integer score) {
        ScoreHistory sh = new ScoreHistory();
        sh.setSource(source);
        sh.setUid(uid);
        sh.setScore(score);
        sh.setCreateTime(new Date());
        shDao.insertSelective(sh);
    }
}
